package cn.iocoder.yudao.module.of.dal.mysql.meetingInfo;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.of.dal.dataobject.meetingInfo.MeetingInfoDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.of.controller.admin.meetingInfo.vo.*;

/**
 * 会议信息 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface MeetingInfoMapper extends BaseMapperX<MeetingInfoDO> {

    default PageResult<MeetingInfoDO> selectPage(MeetingInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MeetingInfoDO>()
                .likeIfPresent(MeetingInfoDO::getName, reqVO.getName())
                .eqIfPresent(MeetingInfoDO::getTypeId, reqVO.getTypeId())
                .eqIfPresent(MeetingInfoDO::getChairpersonId, reqVO.getChairpersonId())
                .likeIfPresent(MeetingInfoDO::getChairpersonName, reqVO.getChairpersonName())
                .eqIfPresent(MeetingInfoDO::getParticipants, reqVO.getParticipants())
                .betweenIfPresent(MeetingInfoDO::getStartTime, reqVO.getStartTime())
                .betweenIfPresent(MeetingInfoDO::getEndTime, reqVO.getEndTime())
                .eqIfPresent(MeetingInfoDO::getTimeLong, reqVO.getTimeLong())
                .eqIfPresent(MeetingInfoDO::getAddress, reqVO.getAddress())
                .eqIfPresent(MeetingInfoDO::getAgenda, reqVO.getAgenda())
                .eqIfPresent(MeetingInfoDO::getAgendaAttachs, reqVO.getAgendaAttachs())
                .eqIfPresent(MeetingInfoDO::getMinutesAttachs, reqVO.getMinutesAttachs())
                .eqIfPresent(MeetingInfoDO::getPriorityId, reqVO.getPriorityId())
                .likeIfPresent(MeetingInfoDO::getPriorityName, reqVO.getPriorityName())
                .eqIfPresent(MeetingInfoDO::getAttachs, reqVO.getAttachs())
                .eqIfPresent(MeetingInfoDO::getRemindType, reqVO.getRemindType())
                .eqIfPresent(MeetingInfoDO::getRepeatPeriod, reqVO.getRepeatPeriod())
                .betweenIfPresent(MeetingInfoDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(MeetingInfoDO::getMainRespDeptId, reqVO.getMainRespDeptId())
                .likeIfPresent(MeetingInfoDO::getMainRespDeptName, reqVO.getMainRespDeptName())
                .eqIfPresent(MeetingInfoDO::getMainRespUserId, reqVO.getMainRespUserId())
                .orderByDesc(MeetingInfoDO::getId));
    }

}